import { createRouter, createWebHistory } from 'vue-router';
import clander from '@/pages/community/CommunityClander.vue';

export const routes = [
  {
    path: '/',
    redirect: '/clander',
  },
  // {
  //   path: '/zh',
  //   redirect: '/zh/clander',
  // },
  {
    path: '/clander',
    name: 'zh_clander',
    component: clander,
    beforeEnter: () => {
      localStorage.setItem('lang', 'zh');
    },
  },
  {
    path: '/clander-detail',
    name: 'zh_clander-detail',
    component: () => {
      return import('@/pages/community/ClanderDetail.vue')
    },
    beforeEnter: () => {
      localStorage.setItem('lang', 'zh');
    },
  },
];

export const router = createRouter({
  history: createWebHistory(),
  routes,
});

// 路由守卫，可在此处进行页面权限处理
// router.beforeEach((to) => {
// if (!isLogined()) {
//   return { name: "home" };
// }
// });
